<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>111</li>
        <li>222</li>
        <li>333</li>
        <li>444</li>
    </ul>

    <script>
        var oUl = document.getElementsByTagName('ul')[0];

        //var oLis = document.getElementsByTagName('li');// HTMLCollections 伪数组 有Dom映射
        var oLis = document.querySelectorAll('li');// NodeList            伪数组 没有dom映射
        // console.dir(oLis);
        console.log(oLis.length);

        var li = document.createElement('li');
        li.innerHTML = '555';

        oUl.appendChild(li);

        console.log(oLis.length);


    </script>
</body>
</html>